<template>
  <div class="homebox">
    <div class="boxrr">
      <van-nav-bar
	  :title="$t('textTrans.提币记录')"
        left-arrow
        @click-left="onClickLeft"
        @click-right="goRight"
      >
      </van-nav-bar>
      <van-tabs v-model="active"  type="card"  color="#00A170" style="margin: 0 0;" @click="onClick">
		  <van-tab 	  :title="$t('textTrans.全部')" ></van-tab>
        <van-tab 	  title="Wait" ></van-tab>
        <van-tab 	  :title="$t('textTrans.已通过')" ></van-tab>
        <van-tab 	  :title="$t('textTrans.已拒绝')" ></van-tab>
        <van-tab 	  :title="$t('textTrans.支付中')" ></van-tab>
      </van-tabs>
      <div v-for="(item, index) in list" :key="index">
        <div
          style="
            background: #bededd;
            border-radius: 5px;
            padding: 15px 10px;
            color: white;
            font-size: 15px;
            width: 88%;
            margin: 5px auto;
            margin-top: 10px;
            align-items: center;
          "
        >
             <div style="display: flex; text-align: left">
            <div
              style="
                color: #fd6f7d;
                font-size: 15px;
                width: 100%;
                text-align: right;
              "
            >
              <span v-if="item.status == 0">{{$t('textTrans.待审核')}}</span>
              <span v-if="item.status == 1">{{$t('textTrans.已通过')}} </span>
              <span v-if="item.status == 2">{{$t('textTrans.已拒绝')}} </span>
              <span v-if="item.status == 3">{{$t('textTrans.支付中')}} </span>
            </div>
          </div>
          <div style="display: flex; text-align: left">
            <div style="font-size: 15px; color: #333;" >
              {{$t('textTrans.提现金额')}}: {{ item.account }}
            </div>
          </div>
          <div>
            <div
              style="
                color: #333;
                margin-top: 6px;
                font-size: 15px;
                word-break: break-all;
              "
            >
            {{$t('textTrans.到账金额')}}  : {{ item.reality_account }}
            </div>
          </div>
          <div>
            <div
              style="
                color: #333;
                margin-top: 6px;
                font-size: 15px;
                word-break: break-all;
              "
            >
              {{$t('textTrans.提现时间')}}   : {{ item.create_time }}
            </div>
          </div>
       <!--   <div style="display: flex; text-align: left">
            <div style="margin-top: 6px; color: #ccc; width: 50%">
              {{ item.create_time }}
            </div>
          </div> -->
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { drawCommit, drawRecordList } from "../../api/home";
export default {
  data() {
    return {
      noticeList: [
        { name: "待审核", id: "0" },
        { name: "已审核", id: "1" },
      ],
      draw_id: "",
      list: [],
      active: 0,
      money: "",
      address: "",
      cuname: "",
      cardinal_number: "",
      pay_password: "",
    };
  },
  created() {
    this.draw_id = '';
    this.getlist();
  },
  methods: {
    onClick(e) {
		if(e>0){
			this.draw_id = e-1
		}else{
			this.draw_id = '';
		}
      this.getlist();
    },
    getlist() {
		
      drawRecordList({ status: this.draw_id }).then((res) => {
        this.list = res;
      });
    },
    goRight() {
      this.$router.push({ path: "withdrawRecord" });
    },
    getrate() {
      this.rate = (this.noticeList[0].rate / 100) * this.money;
    },
    getid(item) {
      this.draw_id = item.id;
      this.getlist();
    },
    submit() {
      let data = {
        draw_id: this.draw_id,
        money: this.money,
        address: this.address,
        pay_password: this.pay_password,
      };
      drawCommit(data).then((res) => {
        this.money = "";
        this.address = "";
        this.pay_password = "";
        this.rate = "";
      });
    },
    onClickLeft() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped lang="less">
	/deep/.van-tabs__nav{
		margin: 0 !important;
	}
.boxrr {
  width: 100%;
}
/deep/.van-cell {
  background: transparent;
  color: white;
}
/deep/.van-field__control {
  color: white;
}
.homebox {
  width: 100%;
  height: 100%;
}
.van-nav-bar {
  background: linear-gradient(
  270deg, #326964 0%, #326964 100%);

  /deep/.van-nav-bar__title {
    color: #ffffff;
  }

  /deep/ .van-icon {
    color: #ffffff;
  }
}
.noticeWrap {
  padding: 0 0px;
  margin-top: 11px;
}
</style>
